3.453 \(\int (a+b \sec ^3(e+f x)) \tan ^3(e+f x) \, dx\)

Optimal. Leaf size=61 \[ \frac {a \sec ^2(e+f x)}{2 f}+\frac {a \log (\cos (e+f x))}{f}+\frac {b \sec ^5(e+f x)}{5 f}-\frac {b \sec ^3(e+f x)}{3 f} \]

[Out]

a*ln(cos(f*x+e))/f+1/2*a*sec(f*x+e)^2/f-1/3*b*sec(f*x+e)^3/f+1/5*b*sec(f*x+e)^5/f

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4138, 1802} \[ \frac {a \sec ^2(e+f x)}{2 f}+\frac {a \log (\cos (e+f x))}{f}+\frac {b \sec ^5(e+f x)}{5 f}-\frac {b \sec ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^3)*Tan[e + f*x]^3,x]

[Out]

(a*Log[Cos[e + f*x]])/f + (a*Sec[e + f*x]^2)/(2*f) - (b*Sec[e + f*x]^3)/(3*f) + (b*Sec[e + f*x]^5)/(5*f)

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \left (a+b \sec ^3(e+f x)\right ) \tan ^3(e+f x) \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {\left (1-x^2\right ) \left (b+a x^3\right )}{x^6} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {b}{x^6}-\frac {b}{x^4}+\frac {a}{x^3}-\frac {a}{x}\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=\frac {a \log (\cos (e+f x))}{f}+\frac {a \sec ^2(e+f x)}{2 f}-\frac {b \sec ^3(e+f x)}{3 f}+\frac {b \sec ^5(e+f x)}{5 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.12, size = 59, normalized size = 0.97 \[ \frac {a \left (\tan ^2(e+f x)+2 \log (\cos (e+f x))\right )}{2 f}+\frac {b \sec ^5(e+f x)}{5 f}-\frac {b \sec ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^3)*Tan[e + f*x]^3,x]

[Out]

-1/3*(b*Sec[e + f*x]^3)/f + (b*Sec[e + f*x]^5)/(5*f) + (a*(2*Log[Cos[e + f*x]] + Tan[e + f*x]^2))/(2*f)

________________________________________________________________________________________

fricas [A]  time = 0.60, size = 59, normalized size = 0.97 \[ \frac {30 \, a \cos \left (f x + e\right )^{5} \log \left (-\cos \left (f x + e\right )\right ) + 15 \, a \cos \left (f x + e\right )^{3} - 10 \, b \cos \left (f x + e\right )^{2} + 6 \, b}{30 \, f \cos \left (f x + e\right )^{5}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^3)*tan(f*x+e)^3,x, algorithm="fricas")

[Out]

1/30*(30*a*cos(f*x + e)^5*log(-cos(f*x + e)) + 15*a*cos(f*x + e)^3 - 10*b*cos(f*x + e)^2 + 6*b)/(f*cos(f*x + e
)^5)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^3)*tan(f*x+e)^3,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(-a/2*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))+a
/2*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))-1))+(-137*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^5*a+805*
((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^4*a-240*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^3*b-1730*((1-cos(f
*x+exp(1)))/(1+cos(f*x+exp(1))))^3*a-80*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*b+1730*((1-cos(f*x+exp(1))
)/(1+cos(f*x+exp(1))))^2*a-80*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b-805*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp
(1)))*a+16*b+137*a)*1/120/((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))-1)^5)

________________________________________________________________________________________

maple [B]  time = 0.98, size = 126, normalized size = 2.07 \[ \frac {a \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {a \ln \left (\cos \left (f x +e \right )\right )}{f}+\frac {b \left (\sin ^{4}\left (f x +e \right )\right )}{5 f \cos \left (f x +e \right )^{5}}+\frac {b \left (\sin ^{4}\left (f x +e \right )\right )}{15 f \cos \left (f x +e \right )^{3}}-\frac {b \left (\sin ^{4}\left (f x +e \right )\right )}{15 f \cos \left (f x +e \right )}-\frac {b \cos \left (f x +e \right ) \left (\sin ^{2}\left (f x +e \right )\right )}{15 f}-\frac {2 b \cos \left (f x +e \right )}{15 f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^3)*tan(f*x+e)^3,x)

[Out]

1/2/f*a*tan(f*x+e)^2+a*ln(cos(f*x+e))/f+1/5/f*b*sin(f*x+e)^4/cos(f*x+e)^5+1/15/f*b*sin(f*x+e)^4/cos(f*x+e)^3-1
/15/f*b*sin(f*x+e)^4/cos(f*x+e)-1/15/f*b*cos(f*x+e)*sin(f*x+e)^2-2/15/f*b*cos(f*x+e)

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 51, normalized size = 0.84 \[ \frac {30 \, a \log \left (\cos \left (f x + e\right )\right ) + \frac {15 \, a \cos \left (f x + e\right )^{3} - 10 \, b \cos \left (f x + e\right )^{2} + 6 \, b}{\cos \left (f x + e\right )^{5}}}{30 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^3)*tan(f*x+e)^3,x, algorithm="maxima")

[Out]

1/30*(30*a*log(cos(f*x + e)) + (15*a*cos(f*x + e)^3 - 10*b*cos(f*x + e)^2 + 6*b)/cos(f*x + e)^5)/f

________________________________________________________________________________________

mupad [B]  time = 8.39, size = 167, normalized size = 2.74 \[ \frac {2\,a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+\left (-6\,a-4\,b\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+\left (6\,a-\frac {4\,b}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\left (-2\,a-\frac {4\,b}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+\frac {4\,b}{15}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}-\frac {2\,a\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^3*(a + b/cos(e + f*x)^3),x)

[Out]

((4*b)/15 - tan(e/2 + (f*x)/2)^2*(2*a + (4*b)/3) - tan(e/2 + (f*x)/2)^6*(6*a + 4*b) + tan(e/2 + (f*x)/2)^4*(6*
a - (4*b)/3) + 2*a*tan(e/2 + (f*x)/2)^8)/(f*(5*tan(e/2 + (f*x)/2)^2 - 10*tan(e/2 + (f*x)/2)^4 + 10*tan(e/2 + (
f*x)/2)^6 - 5*tan(e/2 + (f*x)/2)^8 + tan(e/2 + (f*x)/2)^10 - 1)) - (2*a*atanh(tan(e/2 + (f*x)/2)^2))/f

________________________________________________________________________________________

sympy [A]  time = 2.98, size = 82, normalized size = 1.34 \[ \begin {cases} - \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {b \tan ^{2}{\left (e + f x \right )} \sec ^{3}{\left (e + f x \right )}}{5 f} - \frac {2 b \sec ^{3}{\left (e + f x \right )}}{15 f} & \text {for}\: f \neq 0 \\x \left (a + b \sec ^{3}{\relax (e )}\right ) \tan ^{3}{\relax (e )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**3)*tan(f*x+e)**3,x)

[Out]

Piecewise((-a*log(tan(e + f*x)**2 + 1)/(2*f) + a*tan(e + f*x)**2/(2*f) + b*tan(e + f*x)**2*sec(e + f*x)**3/(5*
f) - 2*b*sec(e + f*x)**3/(15*f), Ne(f, 0)), (x*(a + b*sec(e)**3)*tan(e)**3, True))

________________________________________________________________________________________